package com.data.util;

import lombok.Getter;

@Getter
public enum ResultEnum {

    /**
     * 返回结果枚举，每个枚举代表着一个状态
     */
    SUCCESS(1, "成功"),
    ERROR(0, "失败"),
    PARAM_IS_INVALID(1001, "参数无效"),
    PARAMS_IS_BLANK(1002, "参数为空"),
    PARAMS_TYPE_BIND_ERROR(1003, "参数参数类型错误"),
    PARAMS_NOT_COMPLETE(1004, "参数缺失"),
    PARAMS_IS_ERROR(1005, "参数错误");

    private Integer code;
    private String msg;

    ResultEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer code() {
        return this.code;
    }

    public String msg() {
        return this.msg;
    }
}